﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Demo1.NCondition
{
    class WaitClickEvent : ICondition
    {

        int _clickIndex;

        public WaitClickEvent(int clickIndex)
        {
            _clickIndex = clickIndex;
            Form1._clickEvent += new Form1.clickDelegate(Form1__clickEvent);
        }

        void Form1__clickEvent(int clickindex)
        {
            if (clickindex == _clickIndex)
                _clickIndex = 0;
        }

        public bool IsComplete()
        {
            if (_clickIndex == 0)
                return true;

            return false;
        }


        public void Cancel()
        {

        }
    }
}
